package com.union.vehicleassistant.http.model;

import androidx.annotation.NonNull;

import com.hjq.http.config.IRequestBodyStrategy;
import com.hjq.http.config.IRequestServer;
import com.hjq.http.model.CacheMode;
import com.hjq.http.model.RequestBodyType;
import com.union.vehicleassistant.other.AppConfig;

/**
 * author : Android 轮子哥
 * github : https://github.com/getActivity/AndroidProject
 * time   : 2020/10/02
 * desc   : 服务器配置
 */
public class RequestServer implements IRequestServer {

    @NonNull
    @Override
    public String getHost() {
        return AppConfig.getHostUrl() + "prod-api/";
    }

    @NonNull
    @Override
    public IRequestBodyStrategy getBodyType() {
        return RequestBodyType.FORM;
    }

    @NonNull
    @Override
    public CacheMode getCacheMode() {
        return CacheMode.NO_CACHE;
    }

    @Override
    public long getCacheTime() {
        // 缓存2小时有效
        return 60;
    }
}